All Questions
34 questions
6votes
1answer
663views
Crossword puzzle app
I was hoping someone could give me any tips or advice on this program I wrote for my high school class. The point of the program is to create a workable crossword puzzle in the console. If it works ...
7votes
6answers
9kviews
Printing a Hollow Butterfly pattern
I am a beginner to Java and have studied up to loops only. After loops lecture above pattern was given to print as homework. I have successfully managed to print this pattern with following code: <...
5votes
3answers
271views
Hotel booking with multiple options. Improvement through subclasses?
The code below runs perfectly fine as I want it to. I'd like to create more subclasses to get a better overview over the whole code. Can I place the setter and getter as well as the methods into the ...
1vote
2answers
200views
integer log base 10 function without using java.lang.Math?
I am assigned to a task of creating a function int logBase10Estimate(int n) that returns the log of a number base 10. The answer is integer part only.(w/o using the Math class) Is this okay? ...
4votes
1answer
199views
Parsing weather station XML on raspberry pi
This if for a school project that is all about getting the most performance possible out of a relatively weak computer. For this project we have received a weather station report generator that ...
0votes
1answer
61views
Spaceship Operation in for Lexicographic Comparison
I have written a program in Java 8 using BlueJ. There is just one function of type byte that accepts two String values and return 1 if the first word comes before the second in alphabetical order, and ...
2votes
1answer
2kviews
Salaries exercise
Hey there guys, I have just completed an exercise for uni and I would really like some feedback as I'm pretty new to using java. Areas that I could especially use some input in this instance: ...
3votes
2answers
130views
Add three integers and report the sign of the sum
I am in my first high school programming course; the assignment is: Write a program that asks the user to input three integers and outputs a message indicating their sum and whether it is positive,...
5votes
2answers
2kviews
User input happy birthday program
For self-study homework I made a Java program that takes user input, creates people as objects, and says "Happy Birthday" to each person. I am just wondering what mistakes I made here or how it could ...
4votes
1answer
307views
Drawing consecutive rectangles with an algorithm
I have an assignment to draw rectangles that get larger and larger each time I draw them. Just like shown below. I've labeled them TL = Top Left, TR = Top Right, BL = Bottom Left, BR = Bottom Right. ...
-1votes
1answer
916views
Compound interest calculator homework [closed]
I am a beginner at coding Java and am having a tough time understanding what is wrong with this code. This is an assignment I had posted about earlier and I also went to a Java tutor at my school for ...
2votes
2answers
549views
Integer to Roman Numerals (1 - 2999)
This is a homework assignment. Convert an integer (1 - 2999) to roman numerals. I was wondering if I could make my code more efficient. The way I have it set up is that I take the digits of the input (...
0votes
1answer
692views
Java exercise: String processing and type conversion
The exercise is from a Java-course in which I'm enrolled. The classes Book and APIResponseParser were provided by the instructor. For Book I had to add just a few getter- and setter-methods. For ...
4votes
2answers
8kviews
Pascal's Triangle - Java Recursion
This is a fully functional implementation of a program to ask the user for a location on Pascal's Triangle, but I kind of cheated by expanding the base case to include row 0 and the 1st and last ...
1vote
4answers
97views
Form a [email protected] address, eliminating diacritics from a name
I'm an amateur programmer who just started learning programming, my school gave me an assignment to create code that reads a surname and lastname from an input dialog box and then to edit those name ...